﻿<UserControl x:Class="TriangleView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
            xmlns:local="clr-namespace:Vivei.Tools.Modules.Provisionnement" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="600">
    <Grid Name="MainGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <StackPanel Orientation="Horizontal" Grid.Column="0">
                <TextBlock VerticalAlignment="Center"  Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ViewAnalysis}, Path=ActualWidth}" Margin="5" />
                <ComboBox MinWidth="100" Background="White"  Margin="5" SelectedIndex="0">
                    <ComboBoxItem Content="Survenance" />
                    <ComboBoxItem Content="Declaration" />
                </ComboBox>
                <ComboBox MinWidth="100" Background="White"  Margin="5" SelectedIndex="0">
                    <ComboBoxItem Content="Sinistre" />
                    <ComboBoxItem Content="Provision" />
                </ComboBox>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Grid.Column="1">
                <TextBlock VerticalAlignment="Center"  Text="Max Survenance" Margin="5" />
                <ComboBox Name="MaxSurvenanceComboBox"  VerticalAlignment="Center" Margin="5" Background="White" MinWidth="50"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Grid.Column="2">
                <TextBlock VerticalAlignment="Center"  Text="Min Deroulement" Margin="5" />
                <ComboBox Name="MinDeroulementComboBox" VerticalAlignment="Center"  Margin="5" Background="White" MinWidth="50"/>
            </StackPanel>
            <Button Grid.Column="3"  Background="White" Margin="5" Padding="5" Name="Button1" />
        </Grid>
        <ScrollViewer 
            MaxWidth="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ViewAnalysis}},Path=ActualWidth}"
            MaxHeight="300"
            Grid.Row="1"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch" 
            HorizontalContentAlignment="Stretch" 
            VerticalContentAlignment="Stretch"  MinHeight="100"  >
            <local:SheetGrid 
               
                 x:Name="TriangleGrid"  x:FieldModifier="Public" ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Visible"  />
        </ScrollViewer>
    </Grid>
</UserControl>
